/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
 * Projects
 * Copyright (C) Arnaud Duval 2010 <arnaud.duval@gmail.com>
 * 
 * Projects is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Projects is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _ACTIVITY_ANALYSIS_WINDOW_HPP_
#define _ACTIVITY_ANALYSIS_WINDOW_HPP_

#include <gtkmm.h>
#include <Activity.hpp>
#include "osm-map-area.hpp"
#include "x-y-plot-area.hpp"
#include "double-entry.hpp"
#include "integer-entry.hpp"

///@class ActivityAnalysisDialog

///@brief Defines the main window of the software GUI
class ActivityAnalysisDialog : public Gtk::Dialog
{
    public:
        ///@brief Constructor
        ActivityAnalysisDialog(Activity);
        ///@brief Destructor
        virtual ~ActivityAnalysisDialog();
        ///@brief Set the analysed activity
        void SetActivity(Activity);
    protected:
        ///@brief Update the map with the work track
        void UpdateMap();
        ///@brief Update the curves with the work track
        void UpdateCurves();
        ///@brief Update the displayed track information with the work track
        void UpdateTrackInformations();
        ///@brief Action when clicking on the "apply filter" button
        void on_button_apply_filter_clicked();
        ///@brief Action when clicking on the "reset filter" button
        void on_button_reset_filter_clicked();
        ///@brief Action when clicking on the "smooth elevation" button
        void on_button_smooth_elevation_clicked();

    private:
        ///@brief The analysed activity
        Activity activity;
        ///@brief The GPS track on which we are working
        Track work_track;

        ///@brief HBox that display map and curves
        Gtk::HBox map_curveHBox;
        ///@brief The map
        OsmMapArea theMap;
        ///@brief the curves
        XYPlotArea theCurves;

        ///@brief HBox for filter setup
        Gtk::HBox filterHBox;
        ///@brief Numerical value for the filter
        DoubleEntry filterEntry;
        ///@brief Button to apply the filter
        Gtk::Button filterApplyButton;
        ///@brief Button to reset the filter
        Gtk::Button filterResetButton;
        ///@brief Combo box to choose the type of filter to apply
        Gtk::ComboBoxText filterTypeCBT;

        ///@brief HBox for smoothing tool
        Gtk::HBox smoothHBox;
        ///@brief Numerical value for the smoothing tool
        IntegerEntry smoothEntry;
        ///@brief Button to apply the smoothing tool
        Gtk::Button smoothButton;

        ///@brief HBox for displaying informations from the track
        Gtk::HBox infoHBox;
        ///@brief Label displaying the distance
        Gtk::Label distanceLabel;
        ///@brief Label displaying the total ascent
        Gtk::Label totalAscentLabel;
        ///@brief Label displaying the total descent
        Gtk::Label totalDescentLabel;
        ///@brief Label displaying the average speed
        Gtk::Label averageSpeedLabel;
        ///@brief Label displaying the maximum speed
        Gtk::Label maxSpeedLabel; 
};


#endif  // _ACTIVITY_ANALYSIS_WINDOW_HPP_